package com.sftz.modules.minapp.personal.module;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.nutz.ioc.loader.annotation.Inject;
import org.nutz.ioc.loader.annotation.IocBean;
import org.nutz.log.Log;
import org.nutz.log.Logs;
import org.nutz.mvc.annotation.At;
import org.nutz.mvc.annotation.Ok;
import org.nutz.mvc.annotation.POST;
import org.nutz.mvc.annotation.Param;

import com.sftz.modules.minapp.personal.service.PersonalSetViewService;
/**
 * 学院管理  修改密码
 * @author 郝振斌
 *
 * 2017年12月19日
 */
@IocBean
@At("/wx/personalSet/personal")
public class PersonalSetModule {

	private static final Log log = Logs.get();
	
	@Inject
	private PersonalSetViewService personalSetViewService;
	
	/**
	 *'个人设置'--信息数据
	 */
	@At
	@Ok("json")
	public Object basicInfoJson(@Param("token") final String token) {
		return personalSetViewService.searchBasicInfo(token);
	}
	
	/**
	 * 执行'保存设置'操作
	 */
	@At
	@POST
	@Ok("json")
	public Object saveBasicInfo(@Param("dateJson") final String form,@Param("token") final String token) {
		return personalSetViewService.saveBasicInfo(form,token);
	}
	
	/**
	 * 执行'判断是否重复提交'
	 */
	@At
	@POST
	@Ok("json")
	public Object checkout(HttpServletRequest request,@Param("token") final String token) {
		return personalSetViewService.checkout(request,token);
	}
	

	/**
	 * 执行'保存操作'
	 */
	@At
	@POST
	@Ok("json")
	public Object saveInfo(@Param("content") final String content,@Param("confirmCode") final String confirmCode,
			@Param("token") final String token,HttpServletResponse response,HttpSession session) {
		return personalSetViewService.saveInfo(content,confirmCode,response,session,token);
	}
}